﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Quality.ServiceReference1;

namespace Quality.BasicData
{
    public partial class yycustomers : Form
    {
        public yycustomers()
        {
            InitializeComponent();
            this.dataGridView1.AutoGenerateColumns = false;
        }

        private void querybutton_Click(object sender, EventArgs e)
        {
            DataSet dt = new DataSet();

            Service1SoapClient s = new Service1SoapClient();

            dt = s.getCusList(keytextBox1.Text.Trim());
            dataGridView1.DataSource = dt.Tables[0];
        }

        public event TransfDelegate TransfEvent;
        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            string[] d = new string[2];
            //当点击表头部的列时，e.RowIndex==-1
            if (e.RowIndex > -1)
            {
                d[0] = this.dataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
                d[1] = this.dataGridView1.Rows[e.RowIndex].Cells[1].Value.ToString();
               


                TransfEvent(d);
                this.Close();

            }
        }
    }
}
